﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            dataGridView1.DataSource = tbl;

            xxx.Adapter.RowUpdated += Adapter_RowUpdated;
        }

       
        private void Adapter_RowUpdated(object sender, SqlRowUpdatedEventArgs e)
        {
            MessageBox.Show(e.Errors.Message);
        }

        DataSet1.Table_1DataTable tbl = new DataSet1.Table_1DataTable();

        DataSet1TableAdapters.Table_1TableAdapter xxx = new DataSet1TableAdapters.Table_1TableAdapter();

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                xxx.Fill(tbl);
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.Message);
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                xxx.Update(tbl);
            }
            catch (DBConcurrencyException ex)
            {
                
            }
        }
    }
}
